package com.sywl.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.AccountDao;
import com.sywl.orm.Account;
import com.sywl.service.AccountService;
import com.sywl.util.DataGridModel;

@Service(value="accountService")
@Transactional
public class AccountServiceImpl implements AccountService {
	
	@Resource(name="accountDao")
	private AccountDao accountDao;

	public void save(Account entity) {
		accountDao.save(entity);
	}

	public void update(Account entity) {
		accountDao.update(entity);
	}

	public void delete(Serializable id) {
		accountDao.delete(id);
	}

	public Account findById(Serializable id) {
		return accountDao.findById(id);
	}

	public List<Account> getAll() {
		return accountDao.getAll();
	}

	public List<Account> findByHQL(String hql, Object... params) {
		return accountDao.findByHQL(hql, params);
	}

	public Map<String, Object> getPageList(DataGridModel dgm, Account entity)
			throws Exception {
		return accountDao.getPageList(dgm, entity);
	}

	public void saveAccRoleRelation(Account account) {
		accountDao.saveAccRoleRelation(account);
	}

	public List<Account> getAllAccount() {
		return accountDao.getAllAccount();
	}
	
}
